<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<!-- .breadcrumb -->
	</div>
	<!-- Main content -->
	<div class="page-content">
    	<div class="row">
    	    <div class="page-header">
    			<h1>APP用户信息列表</h1>
    		</div>
    		<div class="col-xs-12">
    		
            	<a class="btn btn-info btn-sm" href="<?php echo base_url()."admin/user/add_user"?>"><i class="icon-copy"></i>新增</a>
            	<a class="btn btn-info btn-sm" href="<?php echo base_url()."admin/user/add_user_by_excel"?>"><i class="icon-copy"></i>批量导入用户</a>
            </div>
    		<div class=" col-md-12 col-sm-12 col-xs-12 form">
                <div class="row">
                <form action="<?php echo base_url().'admin/user/index'?>" method="get" id="search_form">
                   
                    <div class="wh" style="width:30%;">
                    	<label>手机号码：</label>
                        <input type="text"  name="user_phone" value="<?php if (isset($user_phone))echo $user_phone;?>"/>
                    </div>
                    <div class="wh"  style="width:20%;">
                    	<label>登录来源：</label>
                        <select name="third_id">
                            <option value="-1" <?php if (empty($_GET['third_id'])||($_GET['third_id']==-1))echo "selected";?>>全部</option>
								<?php foreach($third as $v):?>
                                    <option value="<?php echo $v['id']?>" <?php if (!empty($_GET['third_id'])&&$_GET['third_id']==$v['id'])echo "selected";?>><?php echo $v['name']?></option>
		                       		<?php endforeach;?>	
						</select>  
                    </div>
                    
				   
				   
				   <div class="wh" style="width:180px;">
                	   <label>车贴审核：</label>
                        <select name="car_status">
                            <option value="-1" <?php if (isset($car_status)&&$car_status == -1)echo "selected";?>>全部</option>
							<option value="0" <?php if (isset($car_status)&&$car_status == 0)echo "selected";?>>未审核</option>
							<option value="1" <?php if (isset($car_status)&&$car_status == 1)echo "selected";?>>已审核</option>
						</select>     
	               </div>
				   
				   
                    <div class="wh" style="width:180px;">
                        <button class="btn btn-sm btn-info" type="button" onclick="search_form(0)"><i class="icon-search"></i>查询</button>
                        <button class="btn btn-sm btn-info" type="button" onclick="search_form(1);"><i class="icon-search"></i>导出</button>
                        
                    </div>
                    <input type="hidden" name="export"  value="0" id="export"/>
                </form>
                <script>
                
				function search_form(export_ex){
					
					$('#export').val(export_ex);
					$('#search_form').submit();
					}
                </script>
                </div>
            </div>
            <input type="hidden" name="upid" id="upid" value=""/>
            <div class="col-xs-12 margin_t margin_b">
				<div class="table-responsive  tab">
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center" style="width: 3%;">
									<label>
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>登录账号</th>
                               
                                <th>车主身份</th>
                                <th>登录来源</th>
								<th>已付款订单</th>
                                <th>余额</th>
                                <th>余额(不可提现)</th>
								<th>车贴审核</th>
                                <th>注册时间</th>
                                
                                <th style="width: 27%;">操作</th>
							</tr>
						</thead> 
						<tbody>
						<?php if (isset($result)&&count($result)>0){
                            	foreach ($result as $app){
                            	?>
							<tr>
								<td class="center">
                                	<p>
									<label>
										<input type="checkbox" class="ace" name="num[]" value="<?php echo $app->id;?>"/>
										<span class="lbl"></span>
									</label>
                                    </p>
								</td>
                                <td><p><?php echo $app->login_name;?></p></td>
                                
                                <td><p><?php if(!empty($app->car_type)){echo '网约车';}else{echo '私家车';}?></p></td>
                                <td><p><?php echo !empty($third[$app->from_third]['name'])?$third[$app->from_third]['name']:'钉铛';?></p></td>
                               
								<td><?php echo $app->order_count;?></td>
                               
                                
                                
                                <td>
                                	<a href="<?php echo base_url().'admin/user/look_user_balance/'.$app->id;?>">
                                		<p><?php echo $app->balance;?></p>
                                	</a>	
                                </td>
                                <td>
                                	<a href="<?php echo base_url().'admin/user/look_user_recharge/'.$app->id;?>">
                                		<p><?php echo $app->recharge;?></p>
                                	</a>	
                                </td>
								<td><p><?php if($app->status==0):?>未审核<?php else:?>已审核<?php endif;?></p></td>
                                <td><p><?php echo $app->create_time;?></p></td>
                               
                                <td><p>
                                	<a href="javascript:void(0)" onclick="recharge('<?php echo $app->id;?>')" data-toggle="modal" class="btn btn-sm btn-info"><i class="icon-edit"></i>充值</a>
									<a href="<?php echo base_url().'admin/order/query?user_phone='.$app->login_name;?>" class="btn btn-sm btn-info"><i class="icon-edit"></i>订单</a>
								    <a class="btn btn-sm btn-info" href="<?php echo base_url().'admin/user/look/'.$app->id;?>"><i class="icon-eye-open"></i>查看</a>
                                    <a class="btn btn-sm btn-info" href="<?php echo base_url().'admin/user/edit/'.$app->id;?>"><i class="icon-edit"></i>编辑</a>
                                
                                    <a href="javascript:void(0)" onclick="delmodal('<?php echo $app->id;?>')" data-toggle="modal" class="btn btn-danger btn-sm"><i class="icon-trash"></i>删除</a>
                                    </p>
                                </td>
    						</tr>
    						<?php }
                            }else{?>
                            <tr>
                            	<td colspan="11">无数据</td>
                            </tr>
                            <?php }?>
                            </tbody>
                         </table>
                     </div><!-- /.table-responsive -->
				</div>
                <div class="col-sm-12">
                	<div class="modal-footer no-margin-top">
	                	<div class="pull-left record">
							共<?php echo $count;?>条记录
	                    </div>
                		<?php if (isset($page))echo $page;?>
                	</div>
                </div>
            </div><!-- /.row -->
		</div><!-- /.page-content -->
	</div><!-- /.main-content -->
	<div id="delModal" class="modal fade" role="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 300px">
			<div class="modal-content">
				<div class="modal-header">
				  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				  <h3>提示信息</h3>
				</div>
				<div class="modal-body">
				  <p>删除后用户将无法使用，确定要删除吗？</p>
				</div>
				<div class="modal-footer">
				  <a id="delbtn" href="#" class="btn btn-danger">确定</a>
				  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
				</div>
			</div>
		</div>
	</div>
<div id="rechargeP" class="modal fade" role="dialog" aria-hidden="true">
<form id="usrform" role="form" action="<?php echo base_url().'admin/user/rec_app_user/';?>" method="post">
  <input id="rec_user_id" name="rec_user_id" type="hidden" value="">
	<div class="modal-dialog" style="width: 300px">
		<div class="modal-content">
			<div class="modal-header">
			  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			  <h3>充值</h3>
			</div>
			<div class="modal-body">
			  <table class="layui-table ct" lay-skin="line">
		  	  <tbody>
				<tr>
					<td><input id="rec_price" name="rec_price" type="text" class="layui-input" style="width: 230px;height:30px;" placeholder="输入...." value="" datatype="*" nullmsg="请输入充值金额！"></td>
				</tr>
		  	  </tbody>
			</table>
			</div>
			<div class="modal-footer">
			<button id="btnSubmit" class="btn btn-danger" type="submit">确定</button>
			<a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
			</div>
		</div>
	</div>
	</form>
</div>
	<script type="text/javascript">
	function delmodal(id){
		$("#delbtn").attr('href','<?php echo base_url().'admin/user/del_app_user/'?>'+id);
	    $('#delModal').modal('show');
	}
	function recharge(id){

		$("#rec_user_id").get(0).value = id;
		
	    $('#rechargeP').modal('show');
	}
	</script>